<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>博客首页</title>
	<link rel="stylesheet" href="../front/css/index.css">
	<link rel="icon" href="${basePath}/front/images/Tomorrow03.png" sizes="32x32">
</head>
<body>
<!-- 顶部导航栏开始 -->
<div class="header">
	<div class="inner">
		<div class="logo">
			<!-- 点击后回到首页 -->
			<a href="/frontIndex" id="boke"><img src="${basePath}/front/images/Tomorrow01.png" alt=""></a>
		</div>
		<div class="nav">
			<ul>
				<li><a href="/article/front/toEditArticle"><i></i>发布文章</a></li>
				<li><a href="/user/front/toRegister"><i></i>注册</a></li>
				<c:if test="${empty user}">
					<li><a href="/user/front/toLogin"><i></i>登录</a></li>
				</c:if>
				<c:if test="${!empty user}">
					<li><a href="/user/userCenter/${user.userId}"><i></i>${user.userName}</a></li>
				</c:if>
				<c:if test="${!empty user}">
					<li><a href="" onclick="userLogout();return false"><i></i>退出登录</a></li>
				</c:if>
			</ul>
		</div>
	</div>
</div>
<!-- 顶部导航栏结束 -->
<!-- banner开始 -->
<div class="banner" id="banner">
	<!-- 这里放轮播图 -->
	<div class="screen">
		<ul>
			<c:forEach items="${hotArticles}" var="article" >
				<li>
					<img src="../front/images/lun01.png" width="1000" height="400">
					<a href="${basePath}/article/front/toArticle/${article.articleId}"><h1>${article.articleTitle}</h1></a>
					<p>${article.articleContent}</p>
				</li>
			</c:forEach>
		</ul>
		<ol>
			<!-- 放轮播图下面的导航点 -->
		</ol>

	</div>
	<div id="arr"><span id="left">&lt;</span><span id="right">&gt;</span></div>
</div>
<!-- banner结束 -->
<!-- 文章排列板块模块massage开始 -->
<div class="massage">
	<div class="date">
		<h3>公告</h3>
		<p>Billboard确认，Taylor Swift新专辑《Lover》首周总销量高达86.7万！！实销高达67.9万！👏👏👏这也是自《reputation》以来美国最高的首周销量！《Lover》也成为2019年美国实销最高的专辑！！Taylor Swift也成为史上第一位拥有6张专辑单周销量超过50万的女歌手！在现在实销疯狂萎缩的市场能取得这样的成绩真的太Slay！！！</p>
	</div>
	<div class="Article">
		<ul class="text">
			<c:forEach items="${newArticles}" var="article">
				<li id="p1" class="current">
					<div><a href="${basePath}/article/front/toArticle/${article.articleId}" class="h3">${article.articleTitle}</a></div>
					<p class="p">${article.articleInfo}</p>
					<span>
						<h6>${article.userName}</h6>
						<p>${article.articleViewNumber}<i></i></p>
						<a href="#">${article.articleBeCollectNum}<i></i></a>
					</span>
					<!-- <img src="images/liPic01.jpg"> -->
				</li>
			</c:forEach>
		</ul>
	</div>
</div>
<!-- 文章排列模块massage结束 -->
<!-- 底部开始	 -->
<div class="bottom">
	<div class="team">
		<span>郑鹏</span>
		<span>钟天福</span>
		<span>王齐乐</span>
		<span>许敏敏</span>
	</div>
	<div class="phone">
		<p>联系方式: &nbsp;<a href="#">xxxx@xx.com</a> | <a href="#">xxxx@xx.com</a> | <a href="#">xxxx@xx.com</a> | <a href="#">xxxx@xx.com</a></p>
	</div>
</div>
<!-- 底部结束 -->
<!-- 回到顶部按钮 -->
<div class="backToTop" id="btnTop">
	<i class="i"></i>
</div>
<!-- 回到顶部按钮 -->
<script src="${basePath}/front/js/index.js"></script>
<script src="${basePath}/front/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
    function userLogout(){
        $.ajax({
            type:'get',
            url:'${basePath}/user/front/logout',
//                data:{"workDataId":workDataId},
            dataType:"json",
            global:false,
            success:function(data){
                console.log(data)
                if (data.success) {
                    alert(data.msg)
                    window.location.href = '${basePath}/frontIndex'
                }else{
                    alert(data.msg)
                }
            }
        });
    }
</script>
</body>
</html>